import { openFloatPane, registerAppMenu } from '@/app'
import { loadBadaData } from './core'
import ClimbFlightEnvelopeVue from './ClimbFlightEnvelope.vue'
import DragTASCalcVue from './DragTASCalc.vue'
import ThrustAltCalcVue from './ThrustAltCalc.vue'
import RocSpdVue from './RocSpd.vue'

export async function setup() {
  await loadBadaData()
  registerAppMenu({
    path: '工具/BADA:BADA 爬升包线',
    onClick() {
      openFloatPane({
        name: 'BADA 爬升包线',
        component: ClimbFlightEnvelopeVue
      })
    }
  })
  registerAppMenu({
    path: '工具/BADA:BADA 速度-阻力',
    onClick() {
      openFloatPane({
        name: 'BADA 速度-阻力',
        component: DragTASCalcVue
      })
    }
  })
  registerAppMenu({
    path: '工具/BADA:BADA 高度-推力',
    onClick() {
      openFloatPane({
        name: 'BADA 高度-推力',
        component: ThrustAltCalcVue
      })
    }
  })
  registerAppMenu({
    path: '工具/BADA:BADA 速度-爬升率',
    onClick() {
      openFloatPane({
        name: 'BADA 速度-爬升率',
        component: RocSpdVue
      })
    }
  })
}
